package cn.tedu.di;

import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestDI {
    @Test
    public void di(){
        ClassPathXmlApplicationContext spring =
                new ClassPathXmlApplicationContext("spring-config.xml");
    Student s = (Student)spring.getBean("student");
        System.out.println(s);
        System.out.println(s.sname);
        System.out.println(s.teacher);
    }

}
